package com.syni.mdd.yhd.common.all.quartz.order.job;

import com.syni.mdd.yhd.common.all.constants.Constants;
import com.syni.mdd.yhd.common.all.entity.BmsDxGroupBuy;
import com.syni.mdd.yhd.common.all.entity.BmsDxOrder;
import com.syni.mdd.yhd.common.all.entity.BmsDxOrderStatus;
import com.syni.mdd.yhd.common.all.service.BmsDxGroupBuyService;
import com.syni.mdd.yhd.common.all.service.BmsDxOrderService;
import com.syni.mdd.yhd.common.all.service.BmsDxOrderStatusService;
import com.syni.mdd.sjb.common.component.utils.common.utils.SpringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @className GroupMessageQuartz
 * @description TOO
 * @Author cfx
 * @DATE 2019/7/8 9:37
 * @VERSION 1.0
 **/
public class OrderCancelTimingJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        BmsDxOrderService bmsDxOrderService = (BmsDxOrderService) SpringUtils.getBean(BmsDxOrderService.class);
        Map<String,Object> paramsMap = jobExecutionContext.getJobDetail().getJobDataMap();
        BmsDxOrder bmsDxOrder = (BmsDxOrder) paramsMap.get("bmsDxOrder");
        bmsDxOrderService.userCancelOrder(bmsDxOrder);
    }
}
